<template>
  <el-main class="WholeBox">
    <el-button type="primary" class="changeModuleBtn" round @click="changeModule">{{module?"注册账号":"前往登录"}}</el-button>
    <Login v-show="module"/>
    <Register v-show="!module"/>
  </el-main>
</template>

<script>
import Login from "@/components/LoginAndRegister/Login";
import Register from "@/components/LoginAndRegister/Register";
export default {
  name: "LoginAndRegister",
  components:{
    Login,
    Register
  },
  data(){
    return {
      module:true,//module表示处于登录界面
    }
  },
  methods: {
    changeModule(){
      this.module=!this.module
    }
  }
}
</script>

<style scoped lang="less">
.WholeBox {
  width: 100%;
  height: 100%;
  position: absolute;
  background-size: 100% 100%;
  background-image: url("@/assets/images/background1.png");
}
.changeModuleBtn {
  position: absolute;
  right: 5%;
  top: 2%;
}
</style>